package org.example.controller;

import org.example.model.AccountsDto;
import org.example.service.AccountsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * @author:Cary
 * @date:2023.06.16
 * @version: dev1.8
 * @deion:用户的控制器
 */
@RestController
public class AccountsController {
    @Autowired
    AccountsService accountsService;
    /**
     * 查询购物车
     * @param: void
     * @return CarPo
     */
    @GetMapping("/accounts/{id}")
    public AccountsDto finAllaccounts(@PathVariable("id") int id){
        return accountsService.findByIdaccounts(id);
    }
}
